Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use upstream spf13 cobra #642

Merged
merged 3 commits into from
Oct 26, 2017
Merged

Conversation

dnephin
Copy link
Contributor

@dnephin dnephin commented Oct 25, 2017

spf13/cobra finally merged all my PRs! So we can use upstream again.

I think the man generation check might fail because the new UseLine adds an unnecessary [flags] after the command. I was able to work around that for the yaml docs and help text, but I'll need to submit another patch to cobra to fix it for the man pages.

Use upstream isntead of fork for cobra.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
@codecov-io
Copy link

codecov-io commented Oct 25, 2017

Codecov Report

Merging #642 into master will decrease coverage by <.01%.
The diff coverage is 3.7%.

@@            Coverage Diff            @@
##           master    #642      +/-   ##
=========================================
- Coverage    49.4%   49.4%   -0.01%     
=========================================
  Files         208     208              
  Lines       17190   17194       +4     
=========================================
+ Hits         8493    8494       +1     
- Misses       8264    8267       +3     
  Partials      433     433

Copy link
Contributor

@mdlinville mdlinville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just don't change any of the keys our Liquid templates rely on. 👼

@@ -8,6 +8,7 @@ Flags:
--cert-expiry duration Validity period for node certificates (ns|us|ms|s|m|h) (default 2160h0m0s)
--dispatcher-heartbeat duration Dispatcher heartbeat period (ns|us|ms|s|m|h) (default 5s)
--external-ca external-ca Specifications of one or more certificate signing endpoints
-h, --help help for update
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, yes, think we previously special-cased -h / --help` and hid it, because using that flag will print the same information as is being printed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, I think we might have been relying on a side-effect of an issue that was fixed in cobra to hide this flag, after we migrated to cobra. I think we can restore the old behaviour by hiding this flag. I'll try it out.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit, but LGTM

@@ -97,9 +98,19 @@ func managementSubCommands(cmd *cobra.Command) []*cobra.Command {
return cmds
}

// UseLine returns the usage line for a command. This implementation is different
// from the default Command.UseLine in that it does not add a `[flags]` to the
// of the line.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed a word here "to the ..... of the line"

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐮

Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit e59f3e2 into docker:master Oct 26, 2017
@dnephin dnephin deleted the use-upstream-spf13-cobra branch October 26, 2017 15:40
@GordonTheTurtle GordonTheTurtle added this to the 17.11.0 milestone Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants